
stone = gr.material({0.8, 0.7, 0.7}, {0.3, 0.3, 0.3}, 20,0)
green = gr.material({0.1, 0.7, 0.1}, {0.3, 0.3, 0.3}, 20,0)
purple = gr.material({0.7, 0.6, 1.0}, {0.5, 0.4, 0.8}, 25)
blue = gr.material({0, 0, 1.0}, {0.3, 0.3, 0.3}, 20, 0)
red = gr.material({1.0, 0.2, 0.1}, {0.3, 0.3, 0.3}, 20,0)
mat4 = gr.material({0.7, 0.6, 1.0}, {0.5, 0.4, 0.8}, 25,0)
scene = gr.node('scene')

p2 = gr.nh_sphere('p2', {0,0,0}, 60)
scene:add_child(p2)
p2:set_material(mat4)
p2:translate(-10, -70, 250)

-- the walls

plane_top = gr.nh_box('plane_top', {0, 0, -10}, 100)
scene:add_child(plane_top)
plane_top:set_material(green)
plane_top:translate(-200,200,-10)
plane_top:scale(4, 0.01, 4)

plane_buttom = gr.nh_box('plane_buttom', {0, 0, -10}, 100)
scene:add_child(plane_buttom)
plane_buttom:set_material(red)
plane_buttom:translate(-200,-200,-10)
plane_buttom:scale(4, 0.01, 4)
--
plane_back = gr.nh_box('plane_back', {0, 0, -10}, 100)
scene:add_child(plane_back)
plane_back:set_material(stone)
plane_back:translate(-200,-200,-10)
plane_back:scale(4, 4, 0.01)

plane_left = gr.nh_box('plane_left', {0, 0, -10}, 100)
scene:add_child(plane_left)
plane_left:set_material(purple)
plane_left:translate(-200,-200,-10)
plane_left:scale(0.01, 4, 4)
plane_left:rotate('z',90)

plane_right = gr.nh_box('plane_right', {0, 0, -10}, 100)
scene:add_child(plane_right)
plane_right:set_material(blue)
plane_right:translate(200,-200,-10)
plane_right:scale(0.01, 4, 4)
plane_right:rotate('z',90)

white_light = gr.light(20,2,{-50.0, 150.0, 450.0}, {0.9, 0.9, 0.9}, {1, 0, 0})
orange_light = gr.light(20,2,{400.0, 100.0, 150.0}, {0.7, 0.0, 0.7}, {1, 0, 0})
gr.render(scene,
	  'softshadow.png', 500, 500,
	  {0, 0, 700}, {0, 0, -1}, {0, 1, 0}, 50,
	  {0.4, 0.4, 0.4}, {white_light},1,0,0,0,0,0)
